package cp.remote.timer;

import android.graphics.Bitmap;
import android.os.Handler;
import android.widget.ImageView;
import cp.remote.config.KinectConfig;

public class KinectTimer implements Runnable {

    private Handler kinect;
    private ImageView temp;
    private boolean running = true;

    int count = 25;
    int data[];

    public KinectTimer(Handler myHandler, ImageView temp) {
        this.kinect = myHandler;
        this.temp = temp;
    }

    public void stop() {
        running = false;
    }

    public void run() {
        if (KinectConfig.netkinect != null && running) {
            Bitmap img = KinectConfig.netkinect.getImg();
            if (img != null) {
                temp.setImageBitmap(img);
                kinect.postDelayed(this, 10);
            }
        }
    }

}
